package com.base.service

import io.swagger.annotations.Api
import io.swagger.annotations.ApiImplicitParam
import io.swagger.annotations.ApiImplicitParams
import io.swagger.annotations.ApiOperation
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RequestMethod
import org.springframework.web.bind.annotation.RequestParam

@Api("service1_feign")
@RequestMapping("/service1_feign")
interface IRPC_Service1_Feign {
    @ApiOperation("callService2")
    @ApiImplicitParams()
    @RequestMapping("/callService2", method = [RequestMethod.POST])
    fun callService2(): String

    @ApiOperation("db_MySQL")
    @ApiImplicitParams(
        ApiImplicitParam(name = "id", value = "数据ID", required = true, dataType = "String")
    )
    @RequestMapping("/db_MySQL", method = [RequestMethod.POST])
    fun db_MySQL(@RequestParam id: String): String

    @ApiOperation("db_MySQL_MP")
    @ApiImplicitParams(
        ApiImplicitParam(name = "id", value = "数据ID", required = true, dataType = "String")
    )
    @RequestMapping("/db_MySQL_MP", method = [RequestMethod.POST])
    fun db_MySQL_MP(@RequestParam id: String): String

    @ApiOperation("db_MongoDB")
    @ApiImplicitParams(
        ApiImplicitParam(name = "id", value = "数据ID", required = true, dataType = "String")
    )
    @RequestMapping("/db_MongoDB", method = [RequestMethod.POST])
    fun db_MongoDB(@RequestParam id: String): String

    @ApiOperation("db_Redis")
    @ApiImplicitParams(
        ApiImplicitParam(name = "id", value = "数据ID", required = true, dataType = "String")
    )
    @RequestMapping("/db_Redis", method = [RequestMethod.POST])
    fun db_Redis(@RequestParam id: String): String

    @ApiOperation("do_seata")
    @ApiImplicitParams(
        ApiImplicitParam(name = "doException", value = "是否触发异常", required = false, dataType = "String")
    )
    @RequestMapping("/do_seata", method = [RequestMethod.POST])
    fun do_feign(@RequestParam doException: String): String

    @ApiOperation("getTokenByUid")
    @ApiImplicitParams(
        ApiImplicitParam(name = "uid", value = "用户id", required = true, dataType = "String")
    )
    @RequestMapping("/getTokenByUid", method = [RequestMethod.POST])
    fun getTokenByUid(@RequestParam uid: String): String
}
